03/08/2015
Send 16-bit word serial messages for the two 74hc595 controllers.
High byte = segments ".gfedcba" active low.
Lowest 4 bits of low byte selects digit(s) to display. High 4 bits = don't care
Send bit 15 first, bit 0 last. Clock each data bit on DIO with a positive SCLK edge.
After 16 bits are clocked in, latch with a positive edge on RCLK. If daisy-chaining, 16 bits per module, then RCLK edge.
Proceed to next digit. Look at avg 5ms per digit or less, to give a steady display.
RCLK and SCLK only cares about rising edges, not levels.
Typically, you will lower RCLK at start of a word, place a bit on DIO and then give SCLK a high pulse.
When all 16 bits are done - raise RCLK again.
Adjust for number of segments. A "1" will be much brighter than a "8" with same delay.
1ms per displayed segment in a digit is a good starting value.
Example: write 12.34
word0: 11111001 00001000 ; segments "1", digit 3, no decimal point, delay=2ms
word1: 00100100 00000100 ; segments "2", digit 2, with decimal point, delay=6ms
word2: 10110000 00000010 ; segments "3", digit 1, no decimal point, delay=5ms
word3: 10011001 00000001 ; segments "4", digit 0, no decimal point, delay=4ms
For small microcontrollers, I suggest lookup tables for both segment encoding and delay.
Add one to delay if decimal point is used on that digit.
Send 16-bit word serial messages for the two 74hc595 controllers.
High byte = segments ".gfedcba" active low.
Lowest 4 bits of low byte selects digit(s) to display. High 4 bits = don't care
Send bit 15 first, bit 0 last. Clock each data bit on DIO with a positive SCLK edge.
After 16 bits are clocked in, latch with a positive edge on RCLK. If daisy-chaining, 16 bits per module, then RCLK edge.
Proceed to next digit. Look at avg 5ms per digit or less, to give a steady display.
RCLK and SCLK only cares about rising edges, not levels.
Typically, you will lower RCLK at start of a word, place a bit on DIO and then give SCLK a high pulse.
When all 16 bits are done - raise RCLK again.
Adjust for number of segments. A "1" will be much brighter than a "8" with same delay.
1ms per displayed segment in a digit is a good starting value.
Example: write 12.34
word0: 11111001 00001000 ; segments "1", digit 3, no decimal point, delay=2ms
word1: 00100100 00000100 ; segments "2", digit 2, with decimal point, delay=6ms
word2: 10110000 00000010 ; segments "3", digit 1, no decimal point, delay=5ms
word3: 10011001 00000001 ; segments "4", digit 0, no decimal point, delay=4ms
For small microcontrollers, I suggest lookup tables for both segment encoding and delay.
Add one to delay if decimal point is used on that digit.
Send 16-bit word serial messages for the two 74hc595 controllers.
High byte = segments ".gfedcba" active low.
Lowest 4 bits of low byte selects digit(s) to display. High 4 bits = don't care
Send bit 15 first, bit 0 last. Clock each data bit on DIO with a positive SCLK edge.
After 16 bits are clocked in, latch with a positive edge on RCLK. If daisy-chaining, 16 bits per module, then RCLK edge.
Proceed to next digit. Look at avg 5ms per digit or less, to give a steady display.
RCLK and SCLK only cares about rising edges, not levels.
Typically, you will lower RCLK at start of a word, place a bit on DIO and then give SCLK a high pulse.
When all 16 bits are done - raise RCLK again.
Adjust for number of segments. A "1" will be much brighter than a "8" with same delay.
1ms per displayed segment in a digit is a good starting value.
Example: write 12.34
word0: 11111001 00001000 ; segments "1", digit 3, no decimal point, delay=2ms
word1: 00100100 00000100 ; segments "2", digit 2, with decimal point, delay=6ms
word2: 10110000 00000010 ; segments "3", digit 1, no decimal point, delay=5ms
word3: 10011001 00000001 ; segments "4", digit 0, no decimal point, delay=4ms
For small microcontrollers, I suggest lookup tables for both segment encoding and delay.
Add one to delay if decimal point is used on that digit.